from owl_ai.domain.agent_config_entity import AgentConfigEntity
from owl_ai.mapper.ai_config_mapper import AgentConfigMapper


class AiAgentConfigService:

    @classmethod
    def insert_config(cls, config: AgentConfigEntity) -> int:
        """
        新增配置信息

        Args:
            config (SysConfig): 配置信息

        Returns:
            int: 新增记录的ID
        """
        return AgentConfigMapper.insert(config)

    @staticmethod
    def select_config(config: AgentConfigEntity) -> AgentConfigEntity:
        """
        查询单个配置信息
        Args:
            config (SysConfig): 配置信息
        Returns:
            Optional[SysConfig]: 配置信息
        """
        return AgentConfigMapper.get(config)

    @staticmethod
    def select_by_id(config_id: int) -> AgentConfigEntity:
        """
        根据ID查询配置信息
        Args:
            config_id (int): 配置ID
        Returns:
            Optional[SysConfig]: 配置信息
        """
        return AgentConfigMapper.select_by_id(config_id)